<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  template="/WEB-INF/layouts/templateBuyer.xhtml">


  <ui:define name="menu">
    <!-- INCLUDE MENU -->
  </ui:define>

  <ui:define name="content">
    <!-- INCLUDE CONTENT -->
    <h1 class="pageTitle">Buyer account</h1>
    <h3 class="pageTitle">Welcome to your buyer session :
      #{conversationScope.user.firstName}
      #{conversationScope.user.lastName}</h3>

    <h2>Tableau de bord de l'acheteur - liste des actions a faire</h2>
	<h:form>
	  <h:dataTable border="1" cellpadding="4" cellspacing="4" first="0" rows="#{conversationScope.nbrProduct}" width="70%" dir="LTR"
		frame="border" rules="all" rowClasses="row1, row2" headerClass="head" value="#{conversationScope.listProduct}" var="lp" bgcolor="#F1F1F1" id="products">
		  <h:column>
			  <f:facet name="header">
				  <f:verbatim>ASIN</f:verbatim>
			  </f:facet>	
			  <h:commandLink id="uid" value="#{lp['idProduct']}" action="productorder">
				  <f:setPropertyActionListener value="#{lp['idProduct']}" target ="#{flowScope.selProduct}"/>
				  <f:setPropertyActionListener value="#{lp['Qte ordered']}" target ="#{flowScope.qtyOrdered}"/>
			  </h:commandLink>
		  </h:column>
		  <h:column>
			  <f:facet name="header">
				  <f:verbatim>Qte en stock</f:verbatim>
			  </f:facet>
			  <h:outputText value="#{lp['Qte en stock']}" />
		  </h:column>
		  <h:column>
			  <f:facet name="header">
				  <f:verbatim>Qte commandee</f:verbatim>
			  </f:facet>
			  <h:outputText value="#{lp['Qte ordered']}" />
		  </h:column>          
	  </h:dataTable>
	</h:form>
  </ui:define>
</ui:composition>
